#include <cpu.h>
#include <verilated_vcd_c.h>
#include <wavetrace.h>

VerilatedVcdC *m_trace;

void init_wave_trace() {
  Verilated::traceEverOn(true);
  m_trace = new VerilatedVcdC;
  dut->trace(m_trace, TRACE_DEPTH);
  m_trace->open(VCD_FILE_PATH);
  printf("init wave trace complete, trace depth:%d ,out: %s\n", TRACE_DEPTH, VCD_FILE_PATH);

}

void dump() {
  m_trace->dump(sim_time);
}

void close_wave_trace() {
  m_trace->close();
  delete m_trace;
}